﻿using FPSO.Models.Constant;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace FPSO.HMI.Controls
{
    /// <summary>
    /// UCSelectTaskQueueView.xaml 的交互逻辑
    /// </summary>
    public partial class UCSelectTaskQueueView : UserControl
    {
        public UCSelectTaskQueueView()
        {
            InitializeComponent();
        }

        public Action<int> QueueClick;

        private void iBtnClose_Click(object sender, MouseButtonEventArgs e)
        {
            OnDateClick(0);
        }

        protected void OnDateClick(int queueId)
        {
            if (QueueClick != null)
            {
                QueueClick(queueId);
            }
        }

        private void btnQueue0_Click(object sender, RoutedEventArgs e)
        {
            OnDateClick(TaskQueueConstant.LOAD_TASK_1_ID);
        }

        private void btnQueue1_Click(object sender, RoutedEventArgs e)
        {
            OnDateClick(TaskQueueConstant.LOAD_TASK_2_ID);
        }

        private void btnQueue2_Click(object sender, RoutedEventArgs e)
        {
            OnDateClick(TaskQueueConstant.UNLOAD_TASK_1_ID);
        }
    }
}
